package com.huanxi.joytravel;

import com.cloud.core.beans.DeviceInfo;
import com.cloud.core.okrx.OkRx;
import com.cloud.core.okrx.events.OnConfigParamsListener;
import com.cloud.core.okrx.properties.OkRxConfigParams;
import com.cloud.core.utils.AppInfoUtils;
import com.huanxi.joytravel.bases.BaseApplication;

import java.util.HashMap;

/**
 * @Author mountainsC
 * @CreateTime:2020/11/30
 * @Description:
 * @Modifier:
 * @ModifyContent:
 */
public class JoyTravelApplication extends BaseApplication {
    private static JoyTravelApplication jtApp = null;
    public static JoyTravelApplication getInstance() {
        return jtApp;
    }
    @Override
    public void onCreate() {
        jtApp = this;
        super.onCreate();
        //okgo网络框架
        OkRx.getInstance().setOnConfigParamsListener(new OnConfigParamsListener() {
            @Override
            public OkRxConfigParams onConfigParamsCall() {
                OkRxConfigParams configParams = new OkRxConfigParams();
                HashMap<String, String> headers = configParams.getHeaders();
                headers.put("Device-type", "android");
//                configParams.setDebug(BuildConfig.isPrintNetRequestLog);
                return configParams;
            }
        });
        OkRx.getInstance().Initialize(this);
    }
}
